package cc.mrbird.febs.moive.controller;


import cc.mrbird.febs.moive.domain.DataTop;
import cc.mrbird.febs.moive.domain.MaxDataOne;
import cc.mrbird.febs.moive.service.MaxDataOneService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@Validated
@RestController
@RequestMapping("maxDataOne")
@Api("电影单日票房最高值")
public class MaxDataOneController {

    @Autowired
    private MaxDataOneService service;

    @GetMapping("/hello")
    public String hello(){
        return "helloworld";
    }


    @GetMapping("/getData")
    @ApiOperation(value = "电影单日票房最高值top20")
    public List<MaxDataOne> getData() {
        log.info("getData");
        List<MaxDataOne> data =  service.getData();
        return data;
    }


    @GetMapping("/getAll")
    @ApiOperation(value = "电影名称列表，给票房走势使用")
    public List<MaxDataOne> getAll() {
        log.info("getData");
        List<MaxDataOne> data =  service.getAll();
        return data;
    }
}
